package(
    default_visibility = ["//visibility:public"],
    licenses = ["notice"],
)

cc_library(
    name = "test_data",
    testonly = True,
    srcs = ["test_data.cc"],
    hdrs = ["test_data.h"],
    deps = [
        "//gutil/gutil:testing",
        "//sai_p4/instantiations/google:sai_pd_cc_proto",
        "@com_google_absl//absl/strings:str_format",
    ],
)

cc_library(
    name = "p4info_push_test",
    testonly = True,
    srcs = ["p4info_push_test.cc"],
    hdrs = ["p4info_push_test.h"],
    deps = [
        "//gutil/gutil:proto_matchers",
        "//gutil/gutil:status_matchers",
        "//lib/gnmi:gnmi_helper",
        "//p4_pdpi:p4_runtime_session",
        "//tests:thinkit_sanity_tests",
        "//tests/lib:switch_test_setup_helpers",
        "//thinkit:mirror_testbed",
        "//thinkit:mirror_testbed_fixture",
        "//thinkit:switch",
        "@com_github_google_glog//:glog",
        "@com_github_p4lang_p4runtime//:p4runtime_cc_proto",
        "@com_google_googletest//:gtest",
    ],
    alwayslink = True,
)

cc_library(
    name = "configure_mirror_testbed_test",
    testonly = True,
    srcs = ["configure_mirror_testbed_test.cc"],
    hdrs = ["configure_mirror_testbed_test.h"],
    deps = [
        "//gutil/gutil:status_matchers",
        "//tests/lib:switch_test_setup_helpers",
        "//thinkit:mirror_testbed_fixture",
        "@com_github_p4lang_p4runtime//:p4info_cc_proto",
        "@com_google_googletest//:gtest",
    ],
    alwayslink = True,
)

cc_library(
    name = "smoke_test",
    testonly = True,
    srcs = ["smoke_test.cc"],
    hdrs = ["smoke_test.h"],
    deps = [
	":mirror_blackbox_test_fixture",
        ":test_data",
        "//gutil/gutil:proto_matchers",
        "//gutil/gutil:status_matchers",
        "//gutil/gutil:testing",
        "//lib/gnmi:gnmi_helper",
        "//p4_pdpi:ir",
        "//p4_pdpi:ir_cc_proto",
	"//p4_pdpi:p4_runtime_session",
        "//p4_pdpi:p4_runtime_session_extras",
        "//p4_pdpi:pd",
        "//p4_pdpi/netaddr:ipv6_address",
        "//p4_pdpi/netaddr:mac_address",
        "//sai_p4/instantiations/google:sai_p4info_cc",
        "//sai_p4/instantiations/google:sai_pd_cc_proto",
        "//sai_p4/instantiations/google/test_tools:test_entries",
        "//tests/lib:p4rt_fixed_table_programming_helper",
        "//tests/lib:switch_test_setup_helpers",
        "//thinkit:mirror_testbed",
        "//thinkit:mirror_testbed_fixture",
        "//thinkit:test_environment",
        "@com_github_p4lang_p4runtime//:p4runtime_cc_proto",
        "@com_google_absl//absl/status",
        "@com_google_absl//absl/strings",
	"@com_google_absl//absl/time",
        "@com_google_googletest//:gtest",
        "@com_google_protobuf//:protobuf",
    ],
    alwayslink = True,
)

cc_library(
    name = "arbitration_test",
    testonly = True,
    srcs = ["arbitration_test.cc"],
    hdrs = ["arbitration_test.h"],
    deps = [
        "//gutil/gutil:status",
        "//gutil/gutil:status_matchers",
        "//gutil/gutil:testing",
        "//p4_pdpi:ir",
        "//p4_pdpi:p4_runtime_session",
        "//tests/lib:p4info_helper",
        "//tests/lib:switch_test_setup_helpers",
        "//thinkit:mirror_testbed_fixture",
        "//thinkit:test_environment",
        "@com_github_grpc_grpc//:grpc++",
        "@com_github_p4lang_p4runtime//:p4runtime_cc_grpc",
        "@com_github_p4lang_p4runtime//:p4runtime_cc_proto",
        "@com_google_absl//absl/numeric:int128",
        "@com_google_absl//absl/status",
        "@com_google_absl//absl/status:statusor",
        "@com_google_absl//absl/strings",
        "@com_google_absl//absl/strings:str_format",
        "@com_google_absl//absl/time",
        "@com_google_googleapis//google/rpc:code_cc_proto",
        "@com_google_googletest//:gtest",
    ],
    alwayslink = True,
)

cc_library(
    name = "util",
    testonly = True,
    srcs = ["util.cc"],
    hdrs = ["util.h"],
    deps = [
        "//gutil/gutil:status",
        "//p4_pdpi:ir_cc_proto",
        "//p4_pdpi:p4_runtime_session",
        "//sai_p4/tools:packetio_tools",
        "@com_google_absl//absl/status",
        "@com_google_absl//absl/status:statusor",
        "@com_google_absl//absl/time",
    ],
)

cc_library(
    name = "packet_test_util",
    testonly = True,
    srcs = ["packet_test_util.cc"],
    hdrs = ["packet_test_util.h"],
    deps = [
        "//dvaas:test_vector",
        "//p4_pdpi/netaddr:ipv4_address",
        "//p4_pdpi/netaddr:ipv6_address",
        "//p4_pdpi/netaddr:mac_address",
        "//p4_pdpi/packetlib",
        "@com_google_absl//absl/base:core_headers",
        "@com_google_absl//absl/container:flat_hash_map",
        "@com_google_absl//absl/status:statusor",
        "@com_google_absl//absl/synchronization",
    ],
)
cc_library(
    name = "group_programming_util",
    testonly = True,
    srcs = ["group_programming_util.cc"],
    hdrs = ["group_programming_util.h"],
    deps = [
        "//gutil/gutil:collections",
        "//gutil/gutil:status",
        "//gutil/gutil:status_matchers",
        "//gutil/gutil:testing",
        "//p4_pdpi:p4_runtime_session",
        "//p4_pdpi:ir_cc_proto",
        "//p4_pdpi:pd",
        "//sai_p4/fixed:p4_ids",
        "//sai_p4/instantiations/google:sai_p4info_cc",
        "//sai_p4/instantiations/google:sai_pd_cc_proto",
        "//thinkit:test_environment",
        "@com_github_p4lang_p4runtime//:p4runtime_cc_proto",
        "@com_google_absl//absl/container:flat_hash_map",
        "@com_google_absl//absl/container:flat_hash_set",
        "@com_google_absl//absl/random",
        "@com_google_absl//absl/random:distributions",
        "@com_google_absl//absl/status",
        "@com_google_absl//absl/status:statusor",
        "@com_google_absl//absl/strings",
        "@com_google_absl//absl/types:span",
        "@com_google_protobuf//:protobuf",
    ],
)

cc_library(
    name = "hash_testfixture",
    testonly = True,
    srcs = ["hash_testfixture.cc"],
    hdrs = ["hash_testfixture.h"],
    deps = [
        ":group_programming_util",
        ":packet_test_util",
        ":util",
        "//gutil/gutil:status",
        "//gutil/gutil:status_matchers",
        "//gutil/gutil:testing",
        "//gutil/gutil:version",
        "//lib/p4rt:p4rt_port",
        "//lib/validator:validator_lib",
        "//p4_pdpi:ir",
        "//p4_pdpi:ir_cc_proto",
        "//p4_pdpi:p4_runtime_session",
        "//p4_pdpi:p4_runtime_session_extras",
        "//p4_pdpi:pd",
        "//p4_pdpi/packetlib",
        "//p4_pdpi/packetlib:packetlib_cc_proto",
        "//sai_p4/instantiations/google:p4_versions",
        "//sai_p4/instantiations/google:sai_pd_cc_proto",
        "//tests/lib:common_ir_table_entries",
        "//tests/lib:packet_generator",
        "//tests/lib:switch_test_setup_helpers",
        "//thinkit:mirror_testbed",
        "//thinkit:mirror_testbed_fixture",
        "//thinkit:switch",
        "//thinkit:test_environment",
        "@com_github_gnoi//system:system_cc_proto",
        "@com_github_google_glog//:glog",
        "@com_github_grpc_grpc//:grpc++",
        "@com_github_p4lang_p4runtime//:p4info_cc_proto",
        "@com_github_p4lang_p4runtime//:p4runtime_cc_proto",
        "@com_google_absl//absl/base:core_headers",
        "@com_google_absl//absl/container:btree",
        "@com_google_absl//absl/container:flat_hash_map",
        "@com_google_absl//absl/container:node_hash_map",
        "@com_google_absl//absl/meta:type_traits",
        "@com_google_absl//absl/status",
        "@com_google_absl//absl/status:statusor",
        "@com_google_absl//absl/strings",
        "@com_google_absl//absl/synchronization",
        "@com_google_absl//absl/time",
        "@com_google_googletest//:gtest",
        "@com_googlesource_code_re2//:re2",
    ],
    alwayslink = True,
)

cc_library(
    name = "hash_statistics_util",
    testonly = True,
    srcs = [
        "hash_statistics_util.cc",
    ],
    hdrs = [
        "hash_statistics_util.h",
    ],
    deps = [
        ":group_programming_util",
        ":hash_testfixture",
        "//gutil/gutil:collections",
        "//gutil/gutil:status",
        "@boost//:bimap",
        "@boost//:graph",
        "@com_github_google_glog//:glog",
        "@com_google_absl//absl/container:btree",
        "@com_google_absl//absl/status",
        "@com_google_absl//absl/strings",
        "@com_google_absl//absl/strings:str_format",
    ],
)

cc_test(
    name = "hash_statistics_util_test",
    srcs = ["hash_statistics_util_test.cc"],
    deps = [
        ":group_programming_util",
        ":hash_statistics_util",
        ":hash_testfixture",
        "//gutil/gutil:status_matchers",
        "@com_github_google_glog//:glog",
        "@com_google_absl//absl/strings",
        "@com_google_googletest//:gtest_main",
    ],
)

cc_library(
    name = "multistage_hash_test",
    testonly = True,
    srcs = ["multistage_hash_test.cc"],
    hdrs = ["multistage_hash_test.h"],
    deps = [
        ":group_programming_util",
        ":hash_statistics_util",
        ":hash_testfixture",
        "//gutil/gutil:status_matchers",
        "//lib/gnmi:gnmi_helper",
        "//lib/p4rt:p4rt_port",
        "//thinkit:switch",
        "@com_github_gnmi//proto/gnmi:gnmi_cc_grpc_proto",
        "@com_github_google_glog//:glog",
        "@com_google_absl//absl/container:flat_hash_map",
        "@com_google_absl//absl/container:flat_hash_set",
        "@com_google_absl//absl/container:node_hash_map",
        "@com_google_absl//absl/status",
        "@com_google_absl//absl/strings",
        "@com_google_googletest//:gtest",
    ],
    alwayslink = True,
)

cc_library(
    name = "arriba_test",
    testonly = True,
    srcs = ["arriba_test.cc"],
    hdrs = ["arriba_test.h"],
    linkstatic = True,
    deps = [
        "//dvaas:arriba_test_vector_validation",
        "//dvaas:mirror_testbed_config",
        "//dvaas:test_vector_cc_proto",
        "//dvaas:validation_result",
        "//lib/p4rt:p4rt_port",
        "//gutil/gutil:status",
        "//gutil/gutil:status_matchers",
        "//p4_pdpi:ir_cc_proto",
        "//p4_pdpi:p4_runtime_session",
        "//p4_pdpi:p4_runtime_session_extras",
        "//thinkit:mirror_testbed_fixture",
        "@com_google_absl//absl/container:btree",
        "@com_google_absl//absl/log",
        "@com_google_googletest//:gtest",
    ],
    alwayslink = True,
)

cc_library(
    name = "ouroboros_test",
    testonly = True,
    srcs = ["ouroboros_test.cc"],
    hdrs = ["ouroboros_test.h"],
    linkstatic = True,
    deps = [
        ":util",
        "//dvaas:dataplane_validation",
        "//dvaas:packet_injection",
        "//dvaas:switch_api",
        "//dvaas:test_vector_cc_proto",
        "//gutil/gutil:proto",
        "//gutil/gutil:status",
        "//gutil/gutil:status_matchers",
        "//lib/gnmi:gnmi_helper",
        "//lib/gnmi:openconfig_cc_proto",
        "//p4_fuzzer:annotation_util",
        "//p4_fuzzer:fuzzer_cc_proto",
        "//p4_fuzzer:fuzzer_config",
        "//p4_fuzzer:mutation_and_fuzz_util",
        "//p4_fuzzer:switch_state",
        "//p4_pdpi:ir_cc_proto",
        "//p4_pdpi:p4_runtime_session",
        "//p4_pdpi:p4_runtime_session_extras",
        "//p4_pdpi:pd",
        "//p4_pdpi/packetlib",
        "//p4_pdpi/packetlib:packetlib_cc_proto",
        "//p4_pdpi/string_encodings:decimal_string",
        "//p4_symbolic/packet_synthesizer:packet_synthesizer_cc_proto",
        "//sai_p4/instantiations/google:sai_pd_cc_proto",
        "//tests/lib:switch_test_setup_helpers",
        "//thinkit:mirror_testbed",
        "//thinkit:mirror_testbed_fixture",
        "//thinkit:test_environment",
        "@com_github_gnmi//proto/gnmi:gnmi_cc_grpc_proto",
        "@com_github_google_glog//:glog",
        "@com_github_p4lang_p4runtime//:p4info_cc_proto",
        "@com_github_p4lang_p4runtime//:p4runtime_cc_proto",
        "@com_google_absl//absl/algorithm:container",
        "@com_google_absl//absl/random",
        "@com_google_absl//absl/status",
        "@com_google_absl//absl/status:statusor",
        "@com_google_absl//absl/strings",
        "@com_google_absl//absl/strings:str_format",
        "@com_google_absl//absl/time",
        "@com_google_googletest//:gtest",
        "@com_google_protobuf//:protobuf",
    ],
    alwayslink = True,
)

cc_library(
    name = "match_action_coverage_test",
    testonly = True,
    srcs = ["match_action_coverage_test.cc"],
    hdrs = ["match_action_coverage_test.h"],
    linkstatic = True,
    deps = [
        "//gutil/gutil:collections",
        "//gutil/gutil:proto",
        "//gutil/gutil:status",
        "//gutil/gutil:status_matchers",
        "//gutil/gutil:version",
        "//lib/gnmi:gnmi_helper",
        "//p4_fuzzer:fuzzer_config",
        "//p4_fuzzer:mutation_and_fuzz_util",
        "//p4_fuzzer:switch_state",
        "//p4_pdpi:built_ins",
        "//p4_pdpi:ir",
        "//p4_pdpi:ir_cc_proto",
        "//p4_pdpi:ir_properties",
        "//p4_pdpi:p4_runtime_session",
        "//p4_pdpi/string_encodings:hex_string",
        "//sai_p4/fixed:p4_ids",
        "//sai_p4/instantiations/google:p4_versions",
        "//tests/lib:switch_test_setup_helpers",
        "//thinkit:mirror_testbed",
        "//thinkit:mirror_testbed_fixture",
        "//thinkit:test_environment",
        "@com_github_p4lang_p4_constraints//p4_constraints/backend:constraint_info",
        "@com_github_p4lang_p4_constraints//p4_constraints/backend:symbolic_interpreter",
        "@com_github_p4lang_p4runtime//:p4info_cc_proto",
        "@com_github_p4lang_p4runtime//:p4runtime_cc_proto",
        "@com_google_absl//absl/container:flat_hash_set",
        "@com_google_absl//absl/log",
        "@com_google_absl//absl/random",
        "@com_google_absl//absl/status",
        "@com_google_absl//absl/status:statusor",
        "@com_google_absl//absl/strings",
        "@com_google_absl//absl/time",
        "@com_google_googletest//:gtest",
    ],
    alwayslink = True,
)

cc_library(
    name = "l3_admit_test",
    testonly = True,
    srcs = ["l3_admit_test.cc"],
    hdrs = ["l3_admit_test.h"],
    deps = [
        ":util",
        "//gutil/gutil:proto",
        "//gutil/gutil:status_matchers",
        "//lib/gnmi:gnmi_helper",
        "//lib/gnmi:openconfig_cc_proto",
        "//lib/p4rt:p4rt_port",
        "//p4_pdpi:ir",
        "//p4_pdpi:ir_cc_proto",
        "//p4_pdpi:p4_runtime_session",
        "//p4_pdpi:p4_runtime_session_extras",
        "//p4_pdpi/netaddr:ipv4_address",
        "//p4_pdpi/packetlib",
        "//p4_pdpi/packetlib:packetlib_cc_proto",
        "//tests/lib:p4info_helper",
	"//tests/lib:p4rt_fixed_table_programming_helper",
        "//tests/lib:switch_test_setup_helpers",
        "//thinkit:mirror_testbed",
        "//thinkit:mirror_testbed_fixture",
        "//thinkit:switch",
        "@com_github_google_glog//:glog",
        "@com_github_p4lang_p4runtime//:p4info_cc_proto",
        "@com_github_p4lang_p4runtime//:p4runtime_cc_proto",
        "@com_google_absl//absl/random",
        "@com_google_absl//absl/status",
        "@com_google_absl//absl/status:statusor",
        "@com_google_absl//absl/strings",
        "@com_google_absl//absl/strings:str_format",
        "@com_google_absl//absl/time",
        "@com_google_googletest//:gtest",
    ],
    alwayslink = True,
)

cc_library(
    name = "fuzzer_tests",
    testonly = True,
    srcs = ["fuzzer_tests.cc"],
    hdrs = ["fuzzer_tests.h"],
    deps = [
        "//gutil/gutil:collections",
        "//gutil/gutil:status",
        "//gutil/gutil:status_matchers",
        "//gutil/gutil:version",
        "//lib/gnmi:gnmi_helper",
        "//lib/p4rt:p4rt_port",
        "//p4_fuzzer:annotation_util",
        "//p4_fuzzer:fuzzer_cc_proto",
        "//p4_fuzzer:fuzzer_config",
        "//p4_fuzzer:mutation_and_fuzz_util",
        "//p4_fuzzer:switch_state",
        "//p4_pdpi:ir_cc_proto",
        "//p4_pdpi:names",
        "//p4_pdpi:p4_runtime_session",
        "//p4_pdpi:p4_runtime_session_extras",
        "//p4_pdpi:sequencing",
        "//sai_p4/instantiations/google:p4_versions",
        "//tests:thinkit_sanity_tests",
        "//tests/lib:switch_test_setup_helpers",
        "//thinkit:mirror_testbed",
        "//thinkit:mirror_testbed_fixture",
        "//thinkit:switch",
        "//thinkit:test_environment",
        "@com_github_gnmi//proto/gnmi:gnmi_cc_proto",
        "@com_github_google_glog//:glog",
        "@com_github_p4lang_p4runtime//:p4info_cc_proto",
        "@com_github_p4lang_p4runtime//:p4runtime_cc_proto",
        "@com_google_absl//absl/algorithm:container",
        "@com_google_absl//absl/container:btree",
        "@com_google_absl//absl/container:flat_hash_set",
        "@com_google_absl//absl/flags:flag",
        "@com_google_absl//absl/random",
        "@com_google_absl//absl/random:seed_sequences",
        "@com_google_absl//absl/status",
        "@com_google_absl//absl/strings",
        "@com_google_absl//absl/time",
        "@com_google_googletest//:gtest",
    ],
)

cc_library(
    name = "watch_port_test",
    testonly = True,
    srcs = ["watch_port_test.cc"],
    hdrs = ["watch_port_test.h"],
    linkstatic = 1,
    deps = [
        ":group_programming_util",
        ":packet_test_util",
        ":util",
        "//dvaas:test_vector_cc_proto",
        "//gutil/gutil:collections",
        "//gutil/gutil:status",
        "//gutil/gutil:status_matchers",
        "//gutil/gutil:testing",
        "//lib/gnmi:gnmi_helper",
        "//lib/gnmi:openconfig_cc_proto",
        "//lib/p4rt:p4rt_port",
        "//lib/validator:validator_lib",
        "//p4_pdpi:ir",
        "//p4_pdpi:ir_cc_proto",
        "//p4_pdpi:p4_runtime_session",
        "//p4_pdpi:pd",
        "//p4_pdpi/packetlib",
        "//p4_pdpi/packetlib:packetlib_cc_proto",
        "//p4_pdpi/string_encodings:decimal_string",
        "//sai_p4/instantiations/google:sai_pd_cc_proto",
        "//sai_p4/instantiations/google/test_tools:test_entries",
        "//tests:thinkit_sanity_tests",
        "//tests/lib:p4rt_fixed_table_programming_helper",
        "//tests/lib:switch_test_setup_helpers",
        "//thinkit:mirror_testbed",
        "//thinkit:mirror_testbed_fixture",
        "//thinkit:switch",
        "//thinkit:test_environment",
        "@com_github_gnmi//proto/gnmi:gnmi_cc_grpc_proto",
        "@com_github_google_glog//:glog",
        "@com_github_grpc_grpc//:grpc++",
        "@com_github_p4lang_p4runtime//:p4info_cc_proto",
        "@com_github_p4lang_p4runtime//:p4runtime_cc_proto",
        "@com_google_absl//absl/container:flat_hash_map",
        "@com_google_absl//absl/container:flat_hash_set",
        "@com_google_absl//absl/functional:bind_front",
        "@com_google_absl//absl/random",
        "@com_google_absl//absl/status",
        "@com_google_absl//absl/status:statusor",
        "@com_google_absl//absl/strings",
        "@com_google_absl//absl/synchronization",
        "@com_google_absl//absl/time",
        "@com_google_absl//absl/types:span",
        "@com_google_googletest//:gtest",
        "@com_googlesource_code_re2//:re2",
    ],
    alwayslink = True,
)

cc_library(
    name = "multicast_fallback_group_test",
    testonly = True,
    srcs = ["multicast_fallback_group_test.cc"],
    hdrs = ["multicast_fallback_group_test.h"],
    linkstatic = 1,
    deps = [
        ":packet_test_util",
        ":util",
        "//dvaas:test_vector_cc_proto",
        "//gutil/gutil:collections",
        "//gutil/gutil:status",
        "//gutil/gutil:status_matchers",
        "//gutil/gutil:testing",
        "//lib/gnmi:gnmi_helper",
        "//lib/gnmi:openconfig_cc_proto",
        "//lib/p4rt:p4rt_port",
        "//p4_pdpi:ir",
        "//p4_pdpi:ir_cc_proto",
        "//p4_pdpi:p4_runtime_session",
        "//p4_pdpi:pd",
        "//p4_pdpi/packetlib",
        "//p4_pdpi/packetlib:packetlib_cc_proto",
        "//sai_p4/instantiations/google:sai_pd_cc_proto",
        "//sai_p4/instantiations/google/test_tools:test_entries",
        "//tests/lib:p4rt_fixed_table_programming_helper",
        "//tests/lib:switch_test_setup_helpers",
        "//thinkit:mirror_testbed",
        "//thinkit:mirror_testbed_fixture",
        "//thinkit:test_environment",
        "@com_github_gnmi//proto/gnmi:gnmi_cc_grpc_proto",
        "@com_github_grpc_grpc//:grpc++",
        "@com_github_p4lang_p4runtime//:p4info_cc_proto",
        "@com_github_p4lang_p4runtime//:p4runtime_cc_proto",
        "@com_google_absl//absl/container:flat_hash_map",
        "@com_google_absl//absl/container:flat_hash_set",
        "@com_google_absl//absl/log",
        "@com_google_absl//absl/status",
        "@com_google_absl//absl/status:statusor",
        "@com_google_absl//absl/strings",
        "@com_google_absl//absl/synchronization",
        "@com_google_absl//absl/time",
        "@com_google_absl//absl/types:span",
        "@com_google_googletest//:gtest",
    ],
    alwayslink = True,
)

cc_library(
    name = "mirror_blackbox_test_fixture",
    testonly = True,
    srcs = ["mirror_blackbox_test_fixture.cc"],
    hdrs = ["mirror_blackbox_test_fixture.h"],
    deps = [
        "//gutil/gutil:status_matchers",
        "//p4_pdpi:p4_runtime_session",
        "//tests/lib:switch_test_setup_helpers",
        "//thinkit:mirror_testbed",
        "//thinkit:mirror_testbed_fixture",
	"//sai_p4/instantiations/google:sai_p4info_cc",
        "//sai_p4/instantiations/google:sai_pd_cc_proto",
        "@com_google_googletest//:gtest",
    ],
)

cc_library(
    name = "packet_at_port",
    hdrs = [
        "packet_at_port.h",
    ],
    deps = [
        "@com_google_absl//absl/strings",
        "@com_google_absl//absl/strings:str_format",
    ],
)
